import cv2

'''
PIL读取的图片通道是RGB
opencv读取的图片通道是BGR
'''
def convertBGR2RGB(img):
    b,g,r = cv2.split(img)  
    return cv2.merge([r,g,b])

def convertRGB2BGR(img):
    r,g,b = cv2.split(img)  
    return cv2.merge([b,g,r])